<%@ tag language="java" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ attribute name="formBody" fragment="true"%>
<%@ attribute name="submitScript" fragment="true"%>
<%@ attribute name="id" required="true"%>
<%@ attribute name="title" required="true"%>
<div class="modal fade" id="${id}" tabindex="-1" role="dialog" aria-labelledby="${id}Label" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title" id="${id}Label">${title}</h4>
      </div>
      <div class="modal-body">
      	<jsp:invoke fragment="formBody"></jsp:invoke>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <c:if test="${not empty submitScript}">
        	<button type="submit" class="btn btn-primary" onclick="${submitScript}">Save</button>
        </c:if>
      </div>
    </div>
  </div>
</div>